package com.itheima.project_cloth.mapper;

import com.itheima.project_cloth.pojo.Cloth;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ClothMapper {

    @Select("select * from tb_cloth where name = #{name}")
    Cloth selectClothByName(String name);


    void updateClothById(Cloth cloth);

    void deleteClothById(List<Integer> ids);

    @Insert("insert into tb_cloth (name,kind_id,detail,price,number,sales,create_time,update_time) values (#{name},#{kindId},#{detail},#{price},#{number},#{sales},#{createTime},#{updateTime})")
    void insert(Cloth cloth);
    @Select("select * from tb_cloth where kind_id=#{kindId}")
    List<Cloth> selectClothByKind_Id(Integer kindId);
}
